package cn.gjxblog.aop.proxy.spring.demo3;

import cn.gjxblog.aop.proxy.spring.demo1.UserService;
import cn.gjxblog.aop.proxy.spring.demo1.UserServiceImpl;
import org.springframework.aop.aspectj.annotation.AspectJProxyFactory;

public class TestAspectJProxyFactory {

    public static void main(String[] args) {
        AspectJProxyFactory aspectJProxyFactory = new AspectJProxyFactory();
        aspectJProxyFactory.setTarget(new UserServiceImpl());
        aspectJProxyFactory.setInterfaces(UserService.class);
        aspectJProxyFactory.addAspect(UserAspect.class);


        UserService proxy = aspectJProxyFactory.getProxy();
        proxy.getUser(2);
    }
}
